import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/auth/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/api/auth',
    method: 'post'
  })
}

export function getUserByToken() {
  return request({
    url: '/api/auth',
    method: 'post'
  })
}

export function updateOne(id, data) {
  return request({
    url: '/api/user/' + id,
    method: 'put',
    data
  })
}

export function resetPwd(id, data) {
  return request({
    url: '/api/user/' + id + '/resetPwd',
    method: 'put',
    data
  })
}
